home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
US Department of Defenseā¦ndamentals 1.0 2004 April
/
US Department of Defense: Firewall & Router Fundamentals 1.0 2004 April.iso
/
text_only
/
includes
/
course_map.js
< prev
next >
Wrap
Text File
|
2003-12-08
|
4KB
|
103 lines
//get the API WINDOW, make sure it is open
if (opener.API_WIN == null) {
if (opener.opener.API_WIN == null) {
alert("The LMS Tracking Window is no longer open.\nThis training requires this window be open.\nPlease re-run this training object...");
window.close();
}
else
var API_WIN = opener.opener.API_WIN;
}
else {
var API_WIN = opener.API_WIN;
}
//get SCO window
if (API_WIN.CONTENT_WIN.SCO_WIN == null) {
alert("The Course Window is no longer open.\nThis training requires this window be open.\nPlease re-run the training object...");
window.close();
}
else {
var SCO_WIN = API_WIN.CONTENT_WIN.SCO_WIN;
}
var CUR_SCO = API_WIN.CUR_SCO;
var CUR_PAGE = SCO_WIN.CUR_PAGE;
var SCO_COMPLETE = false;
if ((API_WIN.SCORM_INITIALIZED) || (API_WIN.FILE_LMS)) {
if ((API_WIN.SCO_STATUS == "c") || (API_WIN.SCO_STATUS == "p"))
SCO_COMPLETE = true;
}
else {
SCO_COMPLETE = true;
}
function load_topic(page_num)
{
SCO_WIN.goto_page(page_num);
window.close();
}
function write_course_map()
{
var list_html = "";
//write top html
list_html += "<TABLE width=100% cellpadding=0 cellspacing=0><TR><TD valign=top width='20'><IMG SRC='../images/course_map/1a.gif' width=20 height=21></TD><TD valign=top width='100%' background='../images/course_map/tbl_bkgrnd.gif'><IMG SRC='../images/course_map/1b.gif' width=30 height=21></TD></TR><TR><TD valign=top><IMG SRC='../images/course_map/2a.gif' width=20 height=239></TD><TD class='reg_text'><CENTER><TABLE width=500><TR><TD class='reg_text'><BR><P align=center class='title_text'>Course Map</P>";
//list SCOS
var is_cur_sco = false;
var is_topic_done = false;
var sco_info = "";
var sco_topics = "";
var sco_topic = "";
var sco_subtopics = "";
var sco_subtopic = "";
var this_sco = "";
list_html += "<OL>";
for (var i=list_iterator(SCO_LIST); iterator_has_next(i); ) {
sco_info = iterator_next(i);
this_sco = hashtable_get(sco_info, "sco_id");
list_html += "<A name='lesson-" + this_sco + "'>";
if (CUR_SCO == this_sco) {
is_cur_sco = true;
list_html += "<LI><B>" + hashtable_get(sco_info, "title") + "</B>";
}
else {
is_cur_sco = false;
list_html += "<LI>" + hashtable_get(sco_info, "title");
}
//if (is_cur_sco) {
list_html += "<OL type='A'>";
sco_topics = hashtable_get(sco_info, "topics");
for (var j=0; j<list_size(sco_topics); j++ ) {
sco_topic = list_get(sco_topics, j);
topic_page = hashtable_get(sco_topic, "page");
if ((is_cur_sco) && ((SCO_COMPLETE) || (parseInt(CUR_PAGE) >= parseInt(topic_page))))
list_html += "<LI><b><a href=\"javascript:load_topic('" + topic_page + "')\";>" + hashtable_get(sco_topic, "title") + "</a></b>";
else {
if (is_cur_sco)
list_html += "<LI><b>" + hashtable_get(sco_topic, "title") + "</b>";
else
list_html += "<LI>" + hashtable_get(sco_topic, "title") + "";
}
sco_subtopics = hashtable_get(sco_topic, "subtopics");
list_html += "<OL>";
for (var k=0; k<list_size(sco_subtopics); k++) {
sco_subtopic = list_get(sco_subtopics, k);
list_html += "<LI>" + hashtable_get(sco_subtopic, "title");
}
list_html += "</OL>";
}
list_html += "</OL>";
//}
}
list_html += "</OL><P align=center><A href='javascript:window.close();'>Close Window</A></P>";
//write bottom html
list_html += "</TD></TR></TABLE></CENTER></TD></TR></TABLE>";
document.write(list_html);
}